<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
    *{margin: 0;padding: 0}
    .parent{
        position: relative;
        width: 300px;
        height: 300px;
        background: salmon;
    }
    .child{
        position: absolute;
        width: 50px;height: 50px;
        background: skyblue;
        left: 50% ;top: 50% ;
        margin-left: -25px;margin-top: -25px;
    }
    </style>
</head>
<body>
    <div class="parent">
        <div class="child">
            
        </div>
    </div>
</body>
</html>